<?php

/**
 * This is the model class for table "tarifairminum".
 *
 * The followings are the available columns in table 'tarifairminum':
 * @property integer $tam_id
 * @property integer $tam_tahun
 * @property double $tam_rumah
 * @property double $tam_pemerintah
 * @property double $tam_niaga
 * @property double $tam_sosial
 * @property double $tam_kran_umum
 * @property double $tam_industri
 */
class Tarifairminum extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Tarifairminum the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'tarifairminum';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('tam_tahun', 'numerical', 'integerOnly'=>true),
			array('tam_rumah, tam_pemerintah, tam_niaga, tam_sosial, tam_kran_umum, tam_industri', 'numerical'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('tam_id, tam_tahun, tam_rumah, tam_pemerintah, tam_niaga, tam_sosial, tam_kran_umum, tam_industri', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'tam_id' => 'Tam',
			'tam_tahun' => 'Tam Tahun',
			'tam_rumah' => 'Tam Rumah',
			'tam_pemerintah' => 'Tam Pemerintah',
			'tam_niaga' => 'Tam Niaga',
			'tam_sosial' => 'Tam Sosial',
			'tam_kran_umum' => 'Tam Kran Umum',
			'tam_industri' => 'Tam Industri',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('tam_id',$this->tam_id);
		$criteria->compare('tam_tahun',$this->tam_tahun);
		$criteria->compare('tam_rumah',$this->tam_rumah);
		$criteria->compare('tam_pemerintah',$this->tam_pemerintah);
		$criteria->compare('tam_niaga',$this->tam_niaga);
		$criteria->compare('tam_sosial',$this->tam_sosial);
		$criteria->compare('tam_kran_umum',$this->tam_kran_umum);
		$criteria->compare('tam_industri',$this->tam_industri);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}